{extend name="./oscshop/admin/view/public/base.html" /}
{block name="content"}
<div class="page-header">
	<h1>
		{$breadcrumb1}
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			{$breadcrumb2}
		</small>	
	</h1>
</div>	

<table class="table table-striped table-bordered table-hover search-form">
	<thead>
		<th><input name="username" type="text" placeholder="输入用户名" value="{:input('param.username')}" /></th>
	
		
		<th>
			<a class="btn btn-primary" href="javascript:;" id="search" url="{:url('PointsBackend/index')}">查询</a>
		</th>
	</thead>
</table>	

<div class="row">
	<div class="col-xs-12">	
		<div class="table-responsive">
			<table class="table table-striped table-bordered table-hover">
				<thead>
					<tr>	
						<th>用户名</th> 
						<th>积分</th> 
						<th>操作</th> 									
						<th>时间</th>	
					</tr>
				</thead>
				<tbody>
						
						{volist name="list" id="d" empty="$empty"}
						<tr>	
							<th>{$d.username}</th>						
							<td>							
								{if condition="$d['prefix'] eq 1 "}
								增加
								{else/}
								减少
								{/if}
								{$d.points}
							</td>
							<td>
								{$d.description}
							</td>
							<td>
								{$d.creat_time|date="y-m-d",###}
							</td>
						</tr>
						{/volist}	
						
						<tr>
							<td colspan="20" class="page">{$list->render()}</td>
						</tr>
					
				</tbody>
				
			</table>
		</div>
	</div>
</div>
{/block}
{block name="javascript"}
<script>	
$(function(){
   $("#search").click(function () {
        var url = $(this).attr('url');
        var query = $('.search-form').find('input,select').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
        query = query.replace(/^&/g, '');
        if (url.indexOf('?') > 0) {
            url += '&' + query;
        } else {
            url += '?' + query;
        }
        window.location.href = url;
    });	
    
});
</script>
{/block}